<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>长沙新闻</title>
</head>
<body>
  
</body>
<script src="/static/js/jquery.min.js"></script>
<script type="text/javascript">
  $(function () {
    $.getJSON('/news/index/list')
     .then(function (r) {
     	let ul = document.createElement('ul');
      	r.errno === 0 && r.data.length !== 0 && r.data.forEach(function doMakeItem(item){
      	  	let li = document.createElement('li');
      	  	let a = document.createElement('a');
      	  	a.href = '/news/index/article?url=' + item.url;
      	  	a.innerHTML = item.title;
      	  	li.appendChild(a);
      	  	ul.appendChild(li);
      	 });
      	document.getElementsByTagName('body').item(0).appendChild(ul);
     });
  });
</script>
</html>